def fun(n):
    if n == 1:
        return 1
    elif n == 2:
        return 2
    else:
        return fun(n-1) + fun(n-2)
n = int(input("请输入台阶数:"))
print(fun(n))


# def go_upstairs(num):
#     if num == 1:
#         return 1
#     elif num ==2 :
#         return 2
#     elif num ==3:
#         return 4
#     else:
#         return go_upstairs(num-1)+go_upstairs(num-2)+go_upstairs(num-3)
# num = int(input("请输入台阶数："))
# print(go_upstairs(num))
